package fun.codedesign.yinxue.code.php2java.rule.word;

import java.util.Arrays;
import java.util.List;

public class KeyWordNeedWhitespaceRule implements WordRule {

    List<String> needWhitespaceKeywords = Arrays.asList(
            // keyword
            "return", "throw", "new"
    );

    @Override
    public boolean isMatch(String originWord) {
        return needWhitespaceKeywords.contains(originWord);
    }

    @Override
    public String invoke(String originWord) {
        // 加空格避免粘连在一起
        return originWord + " ";
    }
}
